import { listenGlobalPagePathChange } from '@/log/listenGlobalPagePathChange';
import { NavigationGuardNext, RouteLocationNormalized } from 'vue-router';
/**
 * 路由前置守卫回调
 * @param to    要去的路由对象
 * @param from  来自的路由对象
 * @param next  放行函数
 */
export const routeForwardGuardCallBack = (
  to: RouteLocationNormalized,
  from: RouteLocationNormalized,
  next: NavigationGuardNext,
): void => {
  next();
};

export const routeBackGuardCallBack = (
  to: RouteLocationNormalized,
  from: RouteLocationNormalized,
): void => {
  // 每一次页面改变进行对变化的页面进行日志生成
  listenGlobalPagePathChange(from, to);
};
